package generator.domain;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 
 * @TableName psychological_tests
 */
@Data
public class PsychologicalTests {
    /**
     * 
     */
    private Integer id;

    /**
     * 测试名称
     */
    private String title;

    /**
     * 测试简介
     */
    private String description;

    /**
     * 封面图
     */
    private String coverImage;

    /**
     * 分类
     */
    private String category;

    /**
     * 价格
     */
    private BigDecimal price;

    /**
     * 预计完成时间（分钟）
     */
    private Integer estimatedTime;

    /**
     * 题目数量
     */
    private Integer questionCount;

    /**
     * 测试须知
     */
    private String instructions;

    /**
     * 完成数量
     */
    private Integer finishCount;

    /**
     * 发布状态
     */
    private Object status;

    /**
     * 创建时间
     */
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    private LocalDateTime updatedAt;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PsychologicalTests other = (PsychologicalTests) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getCoverImage() == null ? other.getCoverImage() == null : this.getCoverImage().equals(other.getCoverImage()))
            && (this.getCategory() == null ? other.getCategory() == null : this.getCategory().equals(other.getCategory()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getEstimatedTime() == null ? other.getEstimatedTime() == null : this.getEstimatedTime().equals(other.getEstimatedTime()))
            && (this.getQuestionCount() == null ? other.getQuestionCount() == null : this.getQuestionCount().equals(other.getQuestionCount()))
            && (this.getInstructions() == null ? other.getInstructions() == null : this.getInstructions().equals(other.getInstructions()))
            && (this.getFinishCount() == null ? other.getFinishCount() == null : this.getFinishCount().equals(other.getFinishCount()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getCoverImage() == null) ? 0 : getCoverImage().hashCode());
        result = prime * result + ((getCategory() == null) ? 0 : getCategory().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getEstimatedTime() == null) ? 0 : getEstimatedTime().hashCode());
        result = prime * result + ((getQuestionCount() == null) ? 0 : getQuestionCount().hashCode());
        result = prime * result + ((getInstructions() == null) ? 0 : getInstructions().hashCode());
        result = prime * result + ((getFinishCount() == null) ? 0 : getFinishCount().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", title=").append(title);
        sb.append(", description=").append(description);
        sb.append(", coverImage=").append(coverImage);
        sb.append(", category=").append(category);
        sb.append(", price=").append(price);
        sb.append(", estimatedTime=").append(estimatedTime);
        sb.append(", questionCount=").append(questionCount);
        sb.append(", instructions=").append(instructions);
        sb.append(", finishCount=").append(finishCount);
        sb.append(", status=").append(status);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append("]");
        return sb.toString();
    }
}